<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <script>
        // 键盘事件
        // 1. 键盘弹起
        document.addEventListener('keyup',function(){
            console.log('起立');
        });

        // 2.按下
        document.addEventListener('keydown',function(){
            console.log('down');
        });

        // 3.按下  不是别一些功能键 ctrl shift 上下左右
        document.addEventListener('keypress',function(){
            console.log('press');
        })
    </script>
</body>
</html>